moved functions into cordova project