refactored report display code