Add validation and tests