code refactoring made