modified validator and exception builder code to be consistent