Replace horrendous code with sanity.