slight style tweaks by @mattnish