api refactoring.