refactor some types