progress with refactoring