Changed all "if x not in kwargs then set it as this" to kwargs.setdefault(x, ...)