Improved usage of exception.