Validation and unit tests