threads: created header for some query routines