create objects with template