Move stuff out of onDeviceReady to test