cleanups and durability socket code