Refactoring the URI handling on Cordova, removing dead code