simplify source lookup and make scan output use json format