Extract the creation of TsdbQuery objects into a QueryBuilder

in this method too