common.py: minor code improvements

Improvements are small, and primarily geared towards:

- code readability
- code maintainability