Very rough draft of client side validator