Most of the install refactor