client rearrange and logging
server cleanup and logging
shared cleanup