refactor scan defs