Fix duplicate code issue.