Using a functor to make the code more readable.