shell script refactoring
script refactoring