Some improvement to old code.