refactoring for admin