reconstruct code, add linux |windows support