pure lua aoi implement