Converted to arc and modern Objective-c syntax