simplify directory iteration