refactor parser methods