Some same code from my work with iOS 7