Got rid of that massive if block