Refactoring admin controller