Updated to make platform-specific code more isolated

Change-Id: Ib9c0d4a8db01e4ffcca9acb4aa817e5700aeaa42