compiler refactoring part 2
compiler refactoring part 3