Parsing code moved from module to Parser class