Refactor data.rb for Raspberry Pi