further setup work and some upgrade logic