separate cafile loading logic into module