I prefer this style for readability and testability:
```erlang
 {ok, BagConfigs} ->
   PoolRecords = [bag_config_to_pool_record(BagConfigs, MasterPoolConfig)
                          || BagConfig <- BagConfigs ],
   true = ets:insert(?ETS_TAB, PoolRecords),
   PoolSpecs = [bag_config_to_pool_spec(BagConfig, MasterPoolConfig)
                          || BagConfig <- BagConfigs ]
 end.

bag_config_to_pool_record({BagIdStr, Address, Port}, MasterPoolConfig) ->
    blah blah blah
    #pool{ key = ... }.

bag_config_to_pool_spec({BagIdStr, Address, Port}, MasterPoolConfig) ->
    Name = list_to_atom(....),
             ...
    {Name, ...}.
```