a complete rewrite of module scanning functionality