I think you can just do `defer.returnValue(result)` here and avoid some `if result` and `result = None` running around.