refactoring

there are some errors in case of refactoring.