fixes, code cleaning and device info