Remove deepcopy, added templatemethod

Signed-off-by: eggfly <lihaohua90@gmail.com>