generating table gateway