Log exceptions only in debug mode
Simplify class hierarchy