Slight code refactor to make make it easier to read.