refactored if/else statement and broke out saveViolation call