Refactored compiler