Rewrite to include proper handler support