Refactoring: reorganized datastructure