cleaned up even more logic.