Refactor and allow nested treemaps