seprated the platform independent functions from platfrom dependent ones