Split parsers into classes and a little cleanup