refactoring root controller