Updated parser's parse() method