todo refactor