Refactoring the build tools a bit.