Continue infrastructure changes and minor optimization in Java implementation