First shot at refactoring setup script