Major refactoring (factorization) for all the layers regarding reports.