Refactor hiding/showing command inputs.