separated schema and model so that nested models can be supported