removing debugging and Query instance