refactored admin controller for codeclimate