Installation script refactoring