some minor tweaks to improve readability and reduce complexity