code refactoring and added bshell