Refactoring before_install.sh