refactoring seems finished