some validations stuff, made simpler