Construct these once at module scope instead of every time this function is called.