cleaned up exception logging
refactored unit tests