Refactored admin functions in different pages