install / update detection + clean code