Added tests and better validators