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