Added features for all devices. Modified and cleaned some codes