Refactoring F1Functions : Replacing anonymous classes using lamdas