refactor shell