Reorganizing parser into separate class