This is just matter of taste but I would move this logic to a HookContext method.