refit_model <- function(m, verbose){
  if((is(m, "lm") || is(m, "glm")) && (is.null(m[["x"]]) || is.null(m[["y"]]))){
    if(isTRUE(verbose)) message("'x' and/or 'y' not found in model object; refitting model...")
    m <- update(object = m, x = TRUE, y = TRUE)
  }
  return(m)
}
