Refined weight code