Code cleanup and fixed bug where all categories were added to the
summary