Move determination of output destination outside of loop
Add sample ugly files
Fix improper indentation in _parse_file
Refactor repetitive code
Clarify comments