made validators a bit more functional