Refactor runCordovaPlatforms