Cleaned up case logic.