build registry for class instances, with registry pattern