Added hierachical model support