Detect which l2 agent to use, factory design pattern style.