restructure
updated api use