refactoring finally coming together