Refining parsing of weight file