refactor into manager
refactor command validation