Refactor, moved folder logic to DirectoryUtils in common.