refactored common "grd5 string" handling