refactor command module