Optimizing phonegap