rewrite Query9 API implementation without traversal framework