refactor to move unwrapping code outside of LFSJSONSerializer