WIP: better dir handling