refactoring weight is done!