improved serializer