Improve app install logic