move validation to resource code