Build updates with some minor code cleanup