Made the  if clause more readable

uses isAuthorized instead of generic condition