Refactoring of shell builtins