optimized code a bit by creating modules to generate repeating parts of the page