refactor **kwargs usage