Some refactor and java version build update