Move all parsing to its own class