Restructure code, implement exception report for iOS