Improve HTML serializer