updated to xcode 5. refactoring and style changes