More refactoring

More refactoring - happy with the structure now, should be reusable for
other reports