various improvements – see individual commits

See the individual commit messages for details on the proposed changes.