Rework internal data structure