Refactors compiler architecture