Refactoring file sending.
Cleaning up logging.