extract common validation functions into mixin