Simple refactoring, moving anonymous function to a function