ended refactoring