added excluding ips and exts; refactory