Imrpoved setup script