cleanup and setup for state.install