remove visualisation related code from device code