refactor common validator; allow specification of message, property name, and instance name