Simplified the code

Simplified the code, updated a comment and added a new function for
changing the default maximum number of idle connections.