Remove unnecessary code in legacy part.