Refactor adaptor to cleanup and use DigitalPin.