Bash code cleanup