Hm not sure I understand what you mean here, but the refactoring of the logic is fine, it's just that recieveDirectoryStatus should be a method on the PathViewModel class rather than a free-floating function which takes the pathModel object to operate on