Refactor page not found behavior.