Split install and upgrade into 2 functions