extracted simple-pool lib