move the bulk of the setup script