Code cleanup: Started moving front-page code generation routines to separate file