Frame handling function now given from application to device class