more API refactoring.