Refactor shell