Refactored Parser::parse()