reduce code overhead in some utility functions
replace some more Python string constants in utility code