restructure and document exceptions
format code to new coding conventions