Clean up the code a little bit and fix "roles" (should be "role")