Refactor installation scripts