Are there issues with iterating over stackToPoolMap? I think in this case, it's okay, since we don't define any additional
properties on stackToPoolMap nor does it inherit anything (that I can tell). 

But it may be useful to do the hasOwnProperty filter thing here anyway to avoid issues in the future.