command refactor