On the structure of generalized quadrangles