Query layer improvements