rewrite query5 API implementation in pure embedded API, removing any use of Steps