refactored validations and declared params