Factor out some trivial utilities.