removes some usages of pushd/popd