Refactor MainParser