Slight rework to tenantmanager.js