Simplified Json writes for memo by using flatMap to catch cases of no match (when it's an Either) as the warning was being supressed before but the code coverage tool was flagging up the untested lines