refactor DRY validation of dynamic content validation