Moved class definition into the else clause