Refactor for Swift 1.0/Xcode 6.0.1