code cleaning: compact code