refactored static pages code