eliminate duplication in static page code