Slight refactor tweaks to make it more readable