if (typeof options === 'function') {
    fn = options;
    options = undefined;
  } else if (typeof template === 'function') {
    fn = template;