refactoring

improved code