Added check for the existence of extension info and a comment for readability.