beautyfing the code