refactoring, in progress