[Fix] Small code refactoring for iOS 8 support