Implement toRawJson and toRawArray