Some refactoring might be needed - you only modified the ES serializer, so the regular one will not benefit from this