thread page fetching, code cleanup