First you strip all the shell then the lungs and soft shell from the inside. If you do not remove the lungs, they go off when the bacteria attacks the soft meat.
Then, wash them in cold clean freshwater, wrap them in cling film, reverse wrap them twice then leave in fridge overnight and freeze the day after. This allows the meat to acclimatise and no shock freezing occurs. (i.e. no sudden temperature falls allowing the meat to split and release the fluids from the inside of the crabs).