renaming of exceptions and adding some comments