optimizing code to capture a modules dir