Refactor parser for more proper testing