reimplement query abstractions