Extract queue behavior to separate class