Refine installation script