code cleaning first part