Finish stage one of code refactoring, on linux X86_64 cross compilation succeed on all platforms, but no real test was done other than linux.