Update generate method.