added some code cleanup.