Move exception creation to factory method