refactor the way to check if user is in role