changes after @simonw review