Refactor in leo_manager_api