refactoring weight