Modernising legacy code with AI