refractored Parser