some cleaning, fix shallow copy bug in spawn