Refactor using modern objective-c syntax for OSX part