Refactored roles and permissions