Slight refactor to remove variables and shorten functions.