move results db queries into their own method