reworked the framework to remove dynamic casting as much as possible
minor modifications for performance testing