refactored validations and associations [skip ci]