added deepRemove method that removes keys with unique ids after use