nit: you can avoid the `dirs` variable by returning map result.