refactor process api