Refactored methods in Scanner and PeekBackReader