Roles refactoring and cleanup