generate initial template from an object