Implement toRawArray and toRawJson