regenerate and throw out old code