more sophisticated scan include, improved build