Major refactoring, developing a more flexible compiler