simplify code: jam similar loops together, create/use utility functions
simplify code: jam similar loops together, create/use utility functions

smspillaz/pychecker,smspillaz/pychecker,smspillaz/pychecker