small cleanup in serializeData