refactoring with multiple directories