Refactor connection pooling and implement part of the command operation.