Rewrote validator.js using validator.prototype = {}