Generalize SerializerFactory