Pools sample refactoring (#478)