Massive refactor to start using new "pools" concept.