Refactor MainParser and Test