init from template