data structure refactor