Cleaned up coding style and modernized for iOS 7