added params and refactoring