Refactor permissions structure