few optimizations
few changes