removed class branch. Moved to hashmap. very much simplified.