Abstract the walk_dir