refactor rating method