Alter the Exceptions API by removing unnecessary side-effect and refactoring code