initial thoughts around a simple connection pool.  also some refactoring, debugging