tidy up _filter_line a bit
made a package