fix bug to use custom template
update template for class and mapper