validation and unit testing