Make operation order consistent where possible.

This makes it easier to
- factor out common code
- see and ensure consistency between variables