Refactored report generator.