Some improvements

- Added more documentation
- Moved the file workflow steps out of the processDirectory method.