refactoring of the setup script