Added support for nested models