move common validator generators into common location