refactoring to work across directories