WIP/Discussion Only - (PDB-657) Query logic refactor