do not construct the function each time