refactor todo.java