Refactored API functions arrangement