refactor check
refactor command and introduce packet