Adapt suggestion from pull/59