internal code cleaning