general code cleaning and quality improvement. bugfix for query templates where offsets were still required even though they aren't supplied anymore.