factor CustomPickler into TypeShape logic