validations and basic unit testing