tiny refactor of APIs