a dirty implementing of pooling, refactoring needed