Modernized to use newer Objective-C syntax.