Made serializer generic