Refactored to generate Try[] instead of throwing
Use apply() instead of encode and decode methods.
Companion objects return Try[]'s