simplified rotation logic to get rid of iOS 6 warnings