refactoring shell file