Authentication and Authorization/Permission system reorganized and refactored