Moved weight_ratio logit into lib class