order imports alphabetically
join content lines in parse_content
refactored parse_file to reduce repeated checks of dry run
extracted inner function to avoid shadowing variables
renamed some vars and methods