Cleaning up code in the parser and registration fragment.