add callback function support + remake sync + tpl review