CLEANUP: separated the script into separate before_script and script blocks