Added IsAuthorized view helper and minor refactoring.