improved editing user with roles
refactored the code a bit