diff --git a/redhat/scripts/clone_tree.sh b/redhat/scripts/clone_tree.sh
index 3ecd08c9fd2ab0271398e537bdd768e3d69deecc..8337b3d8f14114277a6bbdebaa908fcadd07ccdd 100755
--- a/redhat/scripts/clone_tree.sh
+++ b/redhat/scripts/clone_tree.sh
@@ -1,17 +1,6 @@
 #!/bin/bash
 
 # Clones a RHEL dist-git tree using a local reference if existent
-# $1: repository
-# $2: local clone
-# $3: use a different tmp directory (for people with SSDs)
-# $4: package name
-
-repo="$1";
-local="$2";
-tmp_dir="$3";
-package_name="$4";
-rhel_major="$5";
-rhpkg_bin="$6";
 
 function die
 {
@@ -20,23 +9,23 @@ function die
 }
 
 date=$(date +"%Y-%m-%d")
-tmp="$(mktemp -d --tmpdir="$tmp_dir" RHEL"$rhel_major"."$date".XXXXXXXX)";
+tmp="$(mktemp -d --tmpdir="$RHDISTGIT_TMP" RHEL"$RHEL_MAJOR"."$date".XXXXXXXX)";
 cd "$tmp" || die "Unable to create temporary directory";
 
-if [[ -n $repo && -n $local ]]; then
-	git clone --reference "$local" "$repo" "$package_name" >/dev/null || die "Unable to clone using local cache";
+if [[ -n $RHDISTGIT && -n $RHDISTGIT_CACHE ]]; then
+	git clone --reference "$RHDISTGIT_CACHE" "$RHDISTGIT" "$PACKAGE_NAME" >/dev/null || die "Unable to clone using local cache";
 	# if there're tarballs present that are listed in the "sources" file,
 	# copy them or it'll be downloaded again
-	if [ -e "$local/sources" ]; then
+	if [ -e "$RHDISTGIT_CACHE/sources" ]; then
 		while IFS= read -r i; do
-			if [ -f "$local/$i" ]; then
-				cp "$local/$i" "$tmp/kernel/";
+			if [ -f "$RHDISTGIT_CACHE/$i" ]; then
+				cp "$RHDISTGIT_CACHE/$i" "$tmp/kernel/";
 			fi
-		done < "$local"/sources
+		done < "$RHDISTGIT_CACHE"/sources
 	fi
 else
-	echo "No local repo, cloning using $rhpkg_bin" >&2;
-	$rhpkg_bin clone "$package_name" >/dev/null || die "Unable to clone using $rhpkg_bin";
+	echo "No local repo, cloning using $RHPKG_BIN" >&2;
+	$RHPKG_BIN clone "$PACKAGE_NAME" >/dev/null || die "Unable to clone using $RHPKG_BIN";
 fi
 
 echo "$tmp";
diff --git a/redhat/scripts/expand_srpm.sh b/redhat/scripts/expand_srpm.sh
index 1f89b24f17d4b6d384195ac0c5cd271294ef0948..849d0810ce76c7f8b716ebc602ca77895db4398a 100755
--- a/redhat/scripts/expand_srpm.sh
+++ b/redhat/scripts/expand_srpm.sh
@@ -1,18 +1,9 @@
 #!/bin/sh
 
-# $1: git source tree directory
-# $2: cloned tree
-# $3: package name
-# $4: name of srpm
-# shellcheck disable=SC2034     # tree, redhat unused
+# $1: cloned tree
+cloned="$1";
 
-tree="$1";
-cloned="$2";
-package_name="$3";
-redhat="$1/redhat";
-srpm="$4";
-
-cd "$cloned/$package_name" || die "\"$cloned\" doesn't seem to have a dist-git clone";
+cd "$cloned/$PACKAGE_NAME" || die "\"$cloned\" doesn't seem to have a dist-git clone";
 
 # delete everything in the cloned tree to avoid having stale files
 rm -r -- *
@@ -23,7 +14,7 @@ echo "*.xz" > .gitignore
 echo "*.bz2" >> .gitignore
 
 # expand the srpm into the tree
-rpm2cpio "$srpm" | cpio -idmv
+rpm2cpio "$SRPM" | cpio -idmv
 
 git add -A
 
diff --git a/redhat/scripts/rh-dist-git.sh b/redhat/scripts/rh-dist-git.sh
index 745a35c4849869cfbdbeab1a99b2ce343f0899b0..8a4ac0af5c079f921ef13f132d5ad16d4b54f786 100755
--- a/redhat/scripts/rh-dist-git.sh
+++ b/redhat/scripts/rh-dist-git.sh
@@ -23,7 +23,7 @@ fi
 
 echo "Cloning the repository"
 # clone the dist-git, considering cache
-tmpdir=$("$REDHAT"/scripts/clone_tree.sh "$RHDISTGIT" "$RHDISTGIT_CACHE" "$RHDISTGIT_TMP" "$PACKAGE_NAME" "$RHEL_MAJOR" "$RHPKG_BIN");
+tmpdir=$("$REDHAT"/scripts/clone_tree.sh);
 
 echo "Switching the branch"
 # change in the correct branch
@@ -32,7 +32,7 @@ $RHPKG_BIN switch-branch "$RHDISTGIT_BRANCH" || die "switching to branch $RHDIST
 
 echo "Copying updated files"
 # copy the required files (redhat/git/files)
-"$REDHAT"/scripts/expand_srpm.sh "$TOPDIR" "$tmpdir" "$PACKAGE_NAME" "$SRPM";
+"$REDHAT"/scripts/expand_srpm.sh "$tmpdir";
 
 echo "Uploading new tarballs"
 # upload tarballs
@@ -46,7 +46,7 @@ upload_list="$TARBALL $KABI_TARBALL $KABIDW_TARBALL"
 upload $upload_list
 
 echo "Creating diff for review ($tmpdir/diff) and changelog"
-# diff the result (redhat/cvs/dontdiff). note: diff reuturns 1 if
+# diff the result (redhat/git/dontdiff). note: diff reuturns 1 if
 # differences were found
 diff -X "$REDHAT"/git/dontdiff -upr "$tmpdir/$PACKAGE_NAME" "$REDHAT"/rpm/SOURCES/ > "$tmpdir"/diff;
 # creating the changelog file