refactoring the compiler to make it easier to improve