Refactor the added and removed queue