refactor(rating): move logic to controller