outsorced rating function in a separate class