refactor robot api