Updated validator to make it more generic.