Refactor Queue#each.