refactor remove redundant def grab_source