API change and refactoring