Logic cleanup.