sum_ch.py: Refactor for readability