Cleanup work and optimizations for kk build