Second pass at #450

Improvements over 9d274061d4a4d843aeeaf3e697c9a9283fe688f5