move into enclosing function, add filter again, fix comment