Refactoring.
Removing duplication and simplifying the coverage page generation.