improve the api design, wip