Fix incorrect spelling and add util function