improved device filtering