Refactor anonymous function with noop