refactored parser to not look as ugly