Generic class for functions.