refactor cmd_anal