I will present the first results of a newly developed model for galaxy and quasar formation. This model improves with respect to other ``semi-analythic'' models in the level of sophistication of the description of the physical processes included. The results show that it is possible to reproduce the early assembly of massive galaxies, witnessed by the sub-mm counts, and their late nearly-passive evolution, witnessed by the K-band observations at $z<2$. The optical and X-ray properties of the AGN population are reproduced, but only when the very uncertain physics of quasar-triggered winds is introduced; in this case it is possible to obtain good solutions, which however are not unique. We also conclude that the most likely mechanism responsible for the downsizing of AGNs is the kinetic feedback in star-forming bulges due to their high level of turbulence.