Split out command validation from action functions