clean up newlines
extract function, refactor fetchReplacement
implement page prefetcher