construct and query