Pooling factory

This is a PR to address the comments at #1170.