refactored page loader to get insight into memory usage