apply function. #2 example. apply function as a "factory method"