Refactor $user_role ot $user_realm