Upgrade demo project to iOS 7.1
Refactor code