refining the code

refining the code