Cleaned up Termination logic for readability