Split some code out into separate vars to allow better reusability.