refactored datastructure