[FIX] Moved logic to script, more readable, and for some reason env: was not working before.