Updated code with regard to validation types and attributes