optimize setup script.