refactor update weights test