Change polymorphic serialisation to a single hook