when to modernize legacy systems