Improved serializer class