Implemented batch updates. Refactored connection management.