Refactoring DirectoryLocker.cs