refactor: rebuild data structure