ThrowExceptionElement Added and minor changes done to clean up the code