Refactored compiling process