Refactoring

code refactoring