Slight tuning of weight calculation.
Refactoring (renaming only)