refactor application programming interface