OptionParser --> ArgumentParser
provide input files list with generator
wrapped code in functions
introduced some constants
refactored input processing
refactored output processing