Upgrade legacy

Work in progress.