refactor command