rewritten parser class