Framework for merging and nesting data