Major refactoring of reports using groovy templating