function-ize validation