only store the IDs where possible and remove references to data when it is no longer needed