Split out device and platform code