refactors file requirements using Dir object