Minor refactoring of stringformat and contents-index objects