final code cleaning