Remove unused exceptions
Add unit tests