Re #9336 Refactoring old functions. TODO:Still error in old files.