Move UA code into config, service -> factory