made more memory efficient by converting to event process from background process