refactoring for external compilers