debug and massive reconstruct the code structure