Refactor static_pages_spec and utilities