Code refactoring

refactoring