best practices for modernizing legacy systems