refactored compiler code