supervisor refactoring