Refactor for iOS8