Reorg of Java code for data collection

Adding code comments