834445e gather: Clean up code

Authored and Committed by lsedlar 6 years ago
    gather: Clean up code
    
     * add comments explaining what's going on
     * break too long lines
     * simplify the logic where possible
     * use with statement to work with files
     * remove commented out and unused code
     * introduce helpers to reduce code duplication
    
    Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
    
        
file modified
+141 -135
file modified
+21 -31