Generalised much of the code to generate the various content pages