Changes suggested by the ever insightful @metadave