moved queue init to a separate method