simple refactoring of parsers part1