Rewrite summary to deal with nested data