starts refactoring