Added Java version for refactor