refactoring wagerscontroller@update method