Will sort out serialisation issues later, next up I need to clear deleted documents