cleanup the code to prepare cross compilation