improve prefix handling and allow scanned paths to be overridden in subclasses.