refactoring shell termianl