improve reading out the directory