refactoring name of function to validate params