refactoring API