the refactored admin controller