final with anonymous funct but need guidance for refactoring