Refact exception to string formatting