Consider refactoring to eliminate the `if/else` path and calling `setProperty` once, something like;

```
def serialiseNonDateTimeProperty(propName, propValue) {
    if (shouldSerialiseProperty(propName)) {
        
        def propToSerialise = propValue

        if (!isSimple(propValue)) {
            propToSerialise = {
                buildJSON(propValue)
            }
        }
        setProperty(propName, propToSerialise)
    }
}
```