Refactor Queue