improved code readability as per suggestions from @lkolbly and @the-maldridge