Encapsulating platform dependent code in a single module