refactor moga java8