Refactoring 'isAllowedTo'