refactored user/admin checks