Breaking out some utility functions.