refactor Command