refactoring start...