Re-factor reporting to enable sorting.