split script into a before_install and install part