Remove unused function after refactor.