cleanup logging and exceptions