all logic moved to queryhandler