Trying to improve/rewrite scanIntern to use that "power of monadic
composition"

Doesnt work too well
Simplify code a bit more
Simplify even more, extract common command