impl visitCommandNode
refactor