refactor into modular command interface