updates pool and some refactoring
.