data restructure refactoring