refined setup script