Restructuring app for cordova