added generic serializer