Refactoring changes from CLI scripts