Refactor command structure.