Minor refactoring

[skip ci]
Merge branch '1.6' into 1.7

[skip ci]