Relaxed the directory naming convention assumptions (+ some clean-up).