improved gate helpers