Rewritten extension using ValidatorBuilder and metadata cache (thanks to @Majkl578)