Refactor compiler pipeline