Use a trait for abstracting over functions calls (instead of an enum).