Refactoring cross compilation