done code refactoring