refactored data structres