factor out raiseRuntimeException