weight refactoring