rearranged admin logic