Code refactor + thread safe getInstance() for ConnectionPool