Refactor queue delete