cr fixes are added & some code polishing is done