More refactoring

Inlined PoolState
Updated documentation