Using template when creating a new object.