Refactored some build stuff.