Improve the bash script