WIP: Initial Query Builder. Cleanup code