Abstract TableGateway factory