you can replace this code with 
`if current_user.admin?`
 `user_admin_root_url`

but I highly recommend to add **helper methods** such as 'admin?' to the ApplicationController.

Methods should look like this:

def admin?
  current_user.admin?
end

After that you can refactor this chunk of code
`if admin?`
  `...`
`elsif student?`
...