Restructed install script code.