Bash: refactor to multiple files