Cleanup and build improvements

@elingg PTAL