Minor cleanup of duplicate code