Redo legacy code