refactors average rating code in video model