Refactored host functions