template processing complex object