Extract Query computing logic, close #602