fix default query
more cleanups and comments