Refactor kwds