separated schema and model so that nested models can be supported

Hi,
I have separated the schema and model so that nested models can be supported.
Thanks