Refactor the ppu register read/write code