init with template