Changes for kk4.4 and optimizations