Refactored template lookup in .raise()