Replaced Anonymous Function with class function