refactoring for validations on duplicate emps