Move custom-build-related code in its own module