Fn: rebuild and clean rubbish code.