Allowing complex objects with custom templates