tim code cleaning