Made the validators code more structured