refactor the glob stuff to unglob