duplicate code cleanup.