implemented comments from @s1monw, @clintongormley, @martijnvg