refactored data structure