API refactoring