Remove shared pointer usage in Scanner.