Structural insights on desolvation mechanisms of solid state organic and organometallic systems