Some more code cleanup around report generation