Replace the function interface with Consumer<T>