Refactor this

#!/bin/bash

# VALIDITY CHECKING

# check wether these exist

if ! test -f "../../tf2_misc_dir.vpk"; then
	echo Error: unable to find tf_misc_dir.vpk. Are you sure CleanTF2plus is inside the custom folder?
	exit 1
fi
if ! test -f "../../tf2_textures_dir.vpk"; then
	echo Error: unable to find tf_textures_dir.vpk. Are you sure CleanTF2plus is inside the custom folder?
	exit 1
fi
if ! test -f "../../../hl2/hl2_textures_dir.vpk"; then
	echo Error: unable to find hl2 vpk\'s. Make sure you\'re not using symbolic links that prevent access to the hl2 folder, and that CleanTF2plus is inside the custom folder.
	exit 1
fi
if ! test -f "../../../bin/vpk_linux32"; then
	echo Error: unable to find bin/vpk_linux32. Make sure you\'re not using symbolic links that prevent access to the bin folder, and that CleanTF2plus is inside the custom folder.
	exit 1
fi

# DATA

# used variables
# these are set through questions
flat=0
nohats=0
playergibs=0
shells=0
weapongibs=0
surfaceproperties=0
soundscapes=0
mtp=0

# obsolete variables
# to manually enable, set to 1 (Not implemented on Linux)
#overlay=0
#fullbright=0

# QUESTIONS

MTP() {
	echo would you like to add mtp.cfg? Y/N/HELP
	read choice

	if [ $choice == "Y" ]; then
		mtp=1
	elif [ $choice == "N" ]; then
		echo
	elif [ $choice == "HELP" ]; then
		echo this sets which maps are affected by pyrovision
		MTP
	else
		echo invalid input
		MTP
	fi
}

SOUNDSCAPES() {
	echo would you like to remove soundscapes? Y/N/HELP
	read choice

	if [ $choice == "Y" ]; then
		soundscapes=1
		MTP
	elif [ $choice == "N" ]; then
		MTP
	elif [ $choice == "HELP" ]; then
		echo this removes many world sounds from maps
		SOUNDSCAPES
	else
		echo invalid input
		SOUNDSCAPES
	fi
}

SURFACEPROPERTIES() {
	echo would you like to add surfaceproperties? Y/N/HELP
	read choice

	if [ $choice == "Y" ]; then
		surfaceproperties=2
		SOUNDSCAPES
	elif [ $choice == "N" ]; then
		SOUNDSCAPES
	elif [ $choice == "HELP" ]; then
		echo this removes bullet impacts and gets rid of footstep sounds
		SURFACEPROPERTIES
	else
		echo invalid input
		SURFACEPROPERTIES
	fi
}

WEAPONGIBS() {
	echo would you like to remove weapon gibs? Y/N/HELP
	read choice

	if [ $choice == "Y" ]; then
		weapongibs=1
		SURFACEPROPERTIES
	elif [ $choice == "N" ]; then
		SURFACEPROPERTIES
	elif [ $choice == "HELP" ]; then
		echo this removes some gibs from certain projectiles
		WEAPONGIBS
	else
		echo invalid input
		WEAPONGIBS
	fi
}

SHELLS() {
	echo would you like to remove shells from guns? Y/N/HELP
	read choice

	if [ $choice == "Y" ]