Adding functionality to create a new connection if the pool of connections is empty and removed some scrap code