Update legacy code