Refactor resource scanners to take Resource as the argument