Refactored parameters validation and utils