refactoring + changing weights