Add a method for mocking a temporary directory
Remove unnecessary hashing
Refactor helper method