Rewrite and optimization of tax register functionality, some smaller