Refactored out Raspberry Pi specific code