move the validity exception to new package