Some improvements in CountDownLatch usage