Refactored to use Aeson