Improvement to role management logic.