Move debugging method to QueryBuilder class