Use a closure instead of static methods.