added extendClass and extendInstances.