refactors code for duplicate queue item