decouple bucket name and query generator