Use TableGateway instead of plain queries