restructure to handle linux and mac seperately