Moved depth limiting logic to queue class