Improves readability and style as per dougblack's comments