Refactoring to separate data from structure