change code to simpelify