Shell: minor refactoring