abstract new query functionality