commonize confirm process
move some functions into Common. opconf changable.
add debug function
refine deploy code