refactoring code
few changes