started refactoring