refactoring, managers and tests