refactor SourcePosition
refactor scanner