Clean up logic.