Validation

Refactored validation