init with the template; test

Signed-off-by: Qu Xiaofeng <quxiaofeng.at.polyu@gmail.com>