iOS Unified API Support, code reorganization