refactor into command and package