Tweaks - down to 48 LOC
Result of cordova testing