Refactor Ratings class