mod: base code