Refactor node Java