refactoring to use **kwargs