Refactoring for moose and setting up logic for parser