refactor encoder for defer,panic,recover
update decoder for defer,panic,recover
cleanup and reorganizing