refactor ast into two different files