Restructure to include phonegap