refactor into commands