model base code