Rewrite to Either SomeException a

Rewrite to use suggested `enclosed-exceptions` package and `Either` pattern for capturing exceptions