Updated for modern objective-c