refactored Parser.hs