Building directory structure programmatically