refactoring, removed unused code