Convert parser to a class