fix some more formatting

- reduce rightward drift by replacing blocky/ugly lambdas with private
  functions
- make formatting of iterator calls consistent