I remember (but possibly I'm wrong) the similar parsing logic somewhere else in manifest handlers, maybe it's worth to share the code if it is so?