This and fix_extents_overlap should probably remain top-level functions. They don't use self. And they don't really have anything to do with the query per se, so any subclasser of Query (odd in itself even to consider) would be unlikely to want to override them.