Refactoring of compilation related code