Centralize the datetime deserialization in one unique function.