Clean OOP design of parser