API refactored