PMO-2235: externalize some infrastructure code