refactor active record validations