Refactored the IR receiver class