refactored compiler