Refactoring main supervisor