The adaptive process of losing beneficial genes